// pages/message/message.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentIndex: 0,
    "firstList": ["LXT", "LXT", "LXT", "LXT", "LXT", "LXT"],
    "secondList": ["GFF", "GFF", "GFF", "GFF", "GFF", "GFF", "GFF", "GFF"],
    showModals:false,
    nickName:"",
    avatarUrl:""
  },
  //swiper切换时会调用
  pagechange: function(e) {
    if ("touch" === e.detail.source) {
      let currentPageIndex = this.data.currentIndex
      currentPageIndex = (currentPageIndex + 1) % 2
      this.setData({
        currentIndex: currentPageIndex
      })
    }
  },
  dredgeBtn(){
    wx.navigateTo({
      url:"/pages/member/openmember/openmember"
    })
  
  },
  //点击显示
  jihuo(e){
    var that = this
    that.setData({
      showModals: true
    })
  },
  //取消
  cancel() {
    this.setData({
      showModals: false
    })
  },
  hideModal() {
    this.setData({
      showModals: false
    })
  },
  //验证码
  formSubmit(e){
    // this.setData({
    //   showModals: false
    // })
  },
  //用户点击tab时调用
  titleClick: function(e) {
    let currentPageIndex =
      this.setData({
        //拿到当前索引并动态改变
        currentIndex: e.currentTarget.dataset.idx
      })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onShow: function(options) {
    var that=this
   wx.getUserInfo({
     success: function (res) {
       that.setData({
         avatarUrl: res.userInfo.avatarUrl,
         nickName: res.userInfo.nickName
       })
     }
   })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

 

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})